﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows; 

namespace y12fjydbs_1
{
    public class Msg
    {

        public static void MsgShow(string cc)
        {
            MessageBox.Show(cc, "提示");
        }
        public static void ErrShow(string cc)
        {
            MessageBox.Show(cc, "错误", MessageBoxButton.OK, MessageBoxImage.Error);
        }
        public static void WriteLine(string cc)
        {
            Debug.WriteLine(cc);

            try
            {
                string ss = DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss-fff   ") + "  " + cc + "\n";
                File.AppendAllText(MyGlobal.logFile, ss);
            }
            catch (Exception)
            {
            }
        }

        public static void WriteLine(string cc, int? space = 0, char? str = ' ')
        { 
            Debug.WriteLine(DateTime.Now.ToString("HH:mm:ss:fff") + cc.PadLeft(cc.Length + space.Value, str.Value));

            try
            {
                string ss = DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss-fff   ") + "  " + cc + "\n";
                File.AppendAllText(MyGlobal.logFile, ss);
            }
                catch (Exception)
            {
            }
        }

    }
}
